import time

from common.base import Base


class User_center_page(Base):

    user_center_loc=("link text","用户中心")
    my_order=('link text', '我的订单')
    order_num=('css selector', 'tr[align="center"]>td>a')

    def click_user_center(self):
        """用户中心"""
        self.click(self.user_center_loc)
        time.sleep(4)

    def click_my_order(self):
        """点击我的订单"""
        self.click(self.my_order)
        time.sleep(4)

    def get_order_num(self):
        """获取订单号"""
        order_num=self.find_element(self.order_num)
        res=order_num.text
        print(f"我的订单页面的订单号{res}")
        return res






